Repository navigation
NoneType hint: missing return first, then print - #33
Merged
Merged
Conversation
In the design recipe (course Etappe 2) a None operand usually comes from a function that has no return yet - its body is only the docstring while the examples are being written - so the hint pointing only to print sent learners the wrong way. Now: «Ein Wert ist `None`. Fehlt in einer Funktion das `return` – oder gibt sie ihr Ergebnis mit `print` aus?» (en: "A value is `None`. Is a function missing its `return` – or does it output its result with `print`?"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New wording for the hint on a
Noneoperand (package 2, kindnone-operand):None. Gibt eine Funktion ihr Ergebnis mitprintaus statt mitreturn?None. Fehlt in einer Funktion dasreturn– oder gibt sie ihr Ergebnis mitprintaus?None. Does a function output its result withprintinstead ofreturn?None. Is a function missing itsreturn– or does it output its result withprint?In the design recipe (course Etappe 2) the more common cause is a function without a
returnyet: its body is only the docstring while the examples are being written. The old hint sent learners towardsprint.src/i18n.ts(de and en), andscripts/check-error-hints.mjswith the new texts.hints.py,check-runtime-hints.py).Lint (known warning only), both builds,
test:hintsandtest:runtimepass. After the merge I tag a new version and bump the IDE.🤖 Generated with Claude Code